package uk.org.kano.wifilogin;

import uk.org.kano.wifilogin.data.APAdapter;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;

public class ApsActivity extends Activity
{
	// The listview reference
	private ListView apslist = null;
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        // run
        setContentView(R.layout.aps);
        
        // Setup the list view
        apslist = (ListView)this.findViewById(R.id.aps_list);
    }
    
    /**
     * Pause the activity
     */
    @Override
    public void onPause()
    {
    	super.onPause();
    	this.setResult(1);
    }
    
    /**
     * Build the menu
     */
    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
    	MenuInflater inflater = getMenuInflater();
    	inflater.inflate(R.menu.basic_menu, menu);
    	return true;
    }
    
    /**
     * The menu listener
     */
    @Override
    public boolean onOptionsItemSelected(MenuItem item)
    {
    	switch (item.getItemId()) {
    	case R.id.create_item:
    		Intent i = new Intent(this, NewApActivity.class);
    		this.startActivityForResult(i, 0);
    		return true;
    	default:
    		return super.onOptionsItemSelected(item);
    	}
    }
}